package com.menu.system.service.impl;

import com.menu.common.utils.DateUtils;
import com.menu.system.domain.ReceptionDept;
import com.menu.system.mapper.receptionDeptMapper;
import com.menu.system.service.IreceptionDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 部门Service业务层处理
 *
 * @author ruoyi
 * @date 2024-06-06
 */
@Service
public class receptionDeptServiceImpl implements IreceptionDeptService {
    @Autowired
    private receptionDeptMapper receptionDeptMapper;

    /**
     * 查询部门
     *
     * @param deptId 部门主键
     * @return 部门
     */
    @Override
    public ReceptionDept selectreceptionDeptByDeptId(Long deptId) {
        return receptionDeptMapper.selectreceptionDeptByDeptId(deptId);
    }

    /**
     * 查询部门列表
     *
     * @param receptionDept 部门
     * @return 部门
     */
    @Override
    public List<ReceptionDept> selectreceptionDeptList(ReceptionDept receptionDept) {
        return receptionDeptMapper.selectreceptionDeptList(receptionDept);
    }

    /**
     * 新增部门
     *
     * @param receptionDept 部门
     * @return 结果
     */
    @Override
    public int insertreceptionDept(ReceptionDept receptionDept) {
        receptionDept.setCreateTime(DateUtils.getNowDate());
        return receptionDeptMapper.insertreceptionDept(receptionDept);
    }

    /**
     * 修改部门
     *
     * @param receptionDept 部门
     * @return 结果
     */
    @Override
    public int updatereceptionDept(ReceptionDept receptionDept) {
        receptionDept.setUpdateTime(DateUtils.getNowDate());
        return receptionDeptMapper.updatereceptionDept(receptionDept);
    }

    /**
     * 批量删除部门
     *
     * @param deptIds 需要删除的部门主键
     * @return 结果
     */
    @Override
    public int deletereceptionDeptByDeptIds(Long[] deptIds) {
        return receptionDeptMapper.deletereceptionDeptByDeptIds(deptIds);
    }

    /**
     * 删除部门信息
     *
     * @param deptId 部门主键
     * @return 结果
     */
    @Override
    public int deletereceptionDeptByDeptId(Long deptId) {
        return receptionDeptMapper.deletereceptionDeptByDeptId(deptId);
    }
}
